import 'package:flutter_test/flutter_test.dart';
import 'package:component_orion/component_orion.dart';
import 'package:component_orion/component_orion_platform_interface.dart';
import 'package:component_orion/component_orion_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockComponentOrionPlatform
    with MockPlatformInterfaceMixin
    implements ComponentOrionPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final ComponentOrionPlatform initialPlatform = ComponentOrionPlatform.instance;

  test('$MethodChannelComponentOrion is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelComponentOrion>());
  });

  test('getPlatformVersion', () async {
    ComponentOrion componentOrionPlugin = ComponentOrion();
    MockComponentOrionPlatform fakePlatform = MockComponentOrionPlatform();
    ComponentOrionPlatform.instance = fakePlatform;

    expect(await componentOrionPlugin.getPlatformVersion(), '42');
  });
}
